package cn.edu.nju.notification;

import cn.edu.nju.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.widget.TextView;

public class SystemNotificationActivity extends Activity{
	private SystemNotification notification;
	
	@Override
	public void onCreate(Bundle savedInstanceState){
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.system_notification_viewer);
		
		NotificationProvider provider = NotificationProvider.getInstance(this);
		Intent intent = getIntent();
		int position = (Integer)intent.getIntExtra(NotificationActivity.SYSTEM_NOTIFICATION_POSITION, 0);
		notification = provider.getSystemNotifications().get(position);
		
		// init widget
		initNotificationContentText();
	}
	
	private void initNotificationContentText(){
		TextView contentText = (TextView) findViewById(R.id.system_notification_content);
		contentText.setText(notification.getContent());
	}
}
